#include "SkyBoxOsg.h"
#include <SkyBox.h>
SkyBoxOsg::SkyBoxOsg(QObject *parent)
{
    m_object = new SkyBox;
    SkyBox* skyBoxPtr = dynamic_cast<SkyBox*>(m_object.get());
    if(skyBoxPtr != NULL)
    {
        skyBoxPtr->setBackImagePath(std::string("D:/skyImage/back.JPG"));
        skyBoxPtr->setFrontImagePath("D:/skyImage/front.png");
        skyBoxPtr->setLeftImagePath("D:/skyImage/left.jpg");
        skyBoxPtr->setRightImagePath("D:/skyImage/right.jpg");
        skyBoxPtr->setUpImagePath("D:/skyImage/up.png");
        skyBoxPtr->setDownImagePath("D:/skyImage/down.png");
        skyBoxPtr->createSkyBox();
    }
}

SkyBoxOsg::~SkyBoxOsg()
{

}

QString SkyBoxOsg::getImageBackUrl()
{
    return m_imageBackUrl;
}

void SkyBoxOsg::setImageBackUrl(QString url)
{
    m_imageBackUrl = url;

    SkyBox* skyBoxPtr = dynamic_cast<SkyBox*>(m_object.get());
    if(skyBoxPtr != NULL)
    {
        skyBoxPtr->setBackImagePath(m_imageBackUrl.toLocal8Bit().data());
    }
}

QVarintTrigger SkyBoxOsg::getTriggerCreateSkyBox()
{
    return QVarintTrigger();
}

void SkyBoxOsg::setTriggerCreateSkyBox(QVarintTrigger trigger)
{
    SkyBox* skyBoxPtr = dynamic_cast<SkyBox*>(m_object.get());
    if(skyBoxPtr != NULL)
    {
        skyBoxPtr->createSkyBox();
    }
}
